home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Dragging out of a floating palette.
- Sent: 9/10/96 10:45 AM
- Received: 9/10/96 10:45 AM
- From: Mary Boetcher <boetche1@apple.com>
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List
-
-
- >I tried making the floating window FW_MDraggable and adding a drag
- >command, but it needs a selection.
- Not only that, but the selection needs a content object. Is there no end
- to this?!?
-
- The selection and its content specify what data is to be written to the
- storage unit for a drag (or copy) operation. FW_CDragCommand::BeginDrag
- makes this call to externalize the selected data:
- dataInterchange->ExternalizeData(ev,
- fSelection->GetSelectedContent(ev), etc.);
-
- In your selection subclass, you can either create a content object in the
- constructor and keep it around all the time, or you can create one on the
- fly in the selection's GetSelectedContent method. The methods you must
- override in your selection subclass are SelectAll, ClearSelection,
- CloseSelection, IsEmpty, and GetSelectedContent. For your palette, the
- first three methods don't need to do anything. IsEmpty just returns false.
-
- Create the selection object in your part's Initialize method. Then create
- the palette's presentation, passing it the selection object.
-
- The selection method CreateSelectionOutline is called by
- FW_CDragCommand::CreateDragShape, so you can override it to return a
- shape matching the selection item in the palette.
-
- Hope this helps,
-
- Mary Boetcher
- ODF Person